import {Tools} from 'weaver-mobile';

export const loadData = params => {
    return Tools.callApi({
        url: '/api/odoc/odocrequest/loadData',
        method: 'POST',
        params
    });
}

export const importData = params => {
    return Tools.callApi({
        url: '/api/odoc/odocrequest/importData',
        method: 'POST',
        params
    });
}

export const saveData = params => {
    return Tools.callApi({
        url: '/api/odoc/odocrequest/saveData',
        method: 'POST',
        params
    });
}

export const getTableList = params => {
    return Tools.callApi({
        url: '/api/odoc/odocrequest/getTableList',
        method: 'POST',
        params
    });
}

export const flowNext = params => {
    return Tools.callApi({
        url: '/api/odoc/odocrequest/flowNext',
        method: 'POST',
        params
    });
}

export const getLastOperateInfo = params => {
    return Tools.callApi({
        url: '/api/odoc/odocrequest/getLastOperateInfo',
        method: 'POST',
        params
    });
}


export const forceArchive = params => {
    return Tools.callApi({
        url: '/api/odoc/odocrequest/forceArchive',
        method: 'POST',
        params
    });
}


/************************结束本人处理*************************************/
//判断是否是最后一个处理人
export const isEndTreatPerson = params => {
    return Tools.callApi({url: '/api/odoc/odocMenuOperate/getIsEndTreatPerson', method: 'GET', params});
}

export const doEndPersonTreat = params => {
    return Tools.callApi({url: '/api/odoc/odocMenuOperate/doEndPersonTreat', method: 'POST', params});
}


/***************************流程跟踪************************************/
export const doFollowRequest = params => {
    return Tools.callApi({url: '/api/odoc/odocNewTodoList/addTracksReq', method: 'POST', params});
}
export const removeFollowRequest = params => {
    return Tools.callApi({url: '/api/odoc/odocNewTodoList/removeTracksReq', method: 'POST', params});
}

// 获取签字意见分组页面数据
export const getSignGroupPageData = params => {
    return Tools.callApi({url: '/api/odoc/signSetting/getSignGroupPageData', method: 'POST', params});
};

/****************************自定义TAB页签******************************************/
export const getOdocTabManagerDatas = params => {
    return Tools.callApi({url: '/api/odoc/odocMenuOperate/getOdocTabManagerDatas', method: 'GET', params});
}

/****************************签批页签******************************************/
export const isSeal = (params) => {
    return Tools.callApi({url:'/api/odoc/hq/isSeal' , method:'POST', params});
};
export const hasSeal = (params) => {
    return Tools.callApi({url:'/api/odoc/hq/hasSeal' , method:'POST', params});
};
export const checkSeal = (params) => {
    return Tools.callApi({url:'/api/odoc/hq/checkSeal' , method:'POST', params,keepalive:true});
};
